package com.company.cloud.pay.modules.third.models;

import com.alibaba.fastjson.JSON;
import com.company.cloud.pay.constant.ThirdPayReturnCodeEnum;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

@Getter
@Setter
public class ThirdPayResp {

    private String retCode = ThirdPayReturnCodeEnum.TPRC_SUCCESS.getCode();

    private String retMsg = ThirdPayReturnCodeEnum.TPRC_SUCCESS.getCode();

    private String req;

    private String resp;


    /***/
    public void addReq(Map<String, String> params) {
        this.req = JSON.toJSONString(params);
    }

    public void addReq(String req) {
        this.req = req;
    }

    public void addResp(String resp) {
        this.resp = resp;
    }

    /***/
    public void addRetError(String retMsg) {
        this.retCode = ThirdPayReturnCodeEnum.TPRC_FAIL.getCode();
        this.retMsg = retMsg;
    }


}
